<?php

class Db_Tables2_BBu
{
	function __construct() {
		$this->dealers_db = Zend_Registry::get("dealers_db");
	}
	
	function GetBuInfo($bu_id)
	{
		$result = array();
		
		if($bu_id)
		{
			$select = $this->dealers_db->select();
			$select->from("b_bu as b", array("bu_id", "bu_name", "emp_id", "status"));
			$select->joinLeft("b_bu_auth as a", "a.emp_id=b.emp_id", array("group_id_txt", "city_id_txt", "factory_id_txt"));
			$select->where("b.bu_id = ?", $bu_id);
			$data = $this->dealers_db->fetchRow($select);
			
			if($data)
			{
				$result = $data;
			}
		}
		
		return $result;
	}
}